<template>
    <div>
        <div v-for="item in fdata">
            <router-link :to="{ name: 'order', params: { orderId: item.orderId } }">
                <van-card :price="item.totalPrice" :title="item.product_code" :desc="'订单编号:' + item.orderId"
                    :num="'下单时间:' + item.create_time" thumb-link="">
                </van-card>
                <div style="height: 45px;"></div>
            </router-link>
        </div>
    </div>
</template>

<script setup>
import { ref } from 'vue';
import { getOrderListApi } from '@/api/api';
let getOrderListData = ref([])
let fdata = ref([])
getOrderListApi(localStorage.getItem('username')).then((res) => {
    console.log(res);
    getOrderListData.value = res.data.data
    fdata.value = getOrderListData.value
})

const change = (index) => {
    console.log(index);
    if (getOrderListData.value == 0) {
        getOrderListData.value = getOrderListData.value
    }
    if (getOrderListData.value == 1) {
        getOrderListData.value = getOrderListData.value.filter(item => item.status == 1)
    }
    if (getOrderListData.value == 2) {
        getOrderListData.value = getOrderListData.value.fliter(item => item.status == 2)
    }
}

</script>

<style lang="scss" scoped></style>